﻿Imports KOR.Helpers

Namespace BL

    Public Module LabelSizes

#Region "LabelSizes_DML"

        Public Function InsertLabelSize(dict As Dictionary(Of String, Object)) As Integer
            Return DDA.Insert("LabelSizes", dict)
        End Function

        Public Function UpdateLabelSize(dict As Dictionary(Of String, Object), LabelSizeID As Integer) As Integer
            Return DDA.Update("LabelSizes", dict, "LabelSizeID=" & LabelSizeID)
        End Function

        Public Function DeleteLabelSize(ByVal LabelSizeID As Integer) As Integer
            Return DDA.Delete("LabelSizes", "LabelSizeID=" & LabelSizeID, False)
        End Function

#End Region

#Region "LabelSizes_Selection"

        Public Function GetAllLabelSizes() As IDataReader
            Dim sql As String = "SELECT * FROM LabelSizes Order By LabelSizeID DESC"
            Return DDA.SelectData(sql)
        End Function

        Public Function GetLabelSizes(searchFor As String, criteria As String, startRowIndex As Integer, maximumRows As Integer, SortBy As String) As IDataReader
            Dim sql As String
            sql = "SELECT * FROM LabelSizes "

            If SortBy = "" Then SortBy = " CreatedDate Desc"

            Return DDA.SelectDataPaginated(sql, startRowIndex, maximumRows, SortBy)
        End Function

        Public Function LabelSizesCount(searchFor As String, criteria As String) As Integer
            Dim sql As String
            sql = "SELECT * FROM LabelSizes "
            Return DDA.SelectDataCount(sql)
        End Function

#End Region

    End Module

End Namespace
